package com.roncoo.example.util.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 自定义filter
 * 
 * @author wujing
 */
@WebFilter(urlPatterns = "/abc")
public class CustomFilter implements Filter {

  Logger logger = LoggerFactory.getLogger(CustomFilter.class);

	@Override
	public void init(FilterConfig filterConfig) throws ServletException {
    logger.info("init filter");
	}

	@Override
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
			throws IOException, ServletException {
    logger.info("do filter");
      //chain.doFilter(request, response);
	}

	@Override
	public void destroy() {
    logger.info("destroy filter");
	}

}
